
package com.balance.anole.client.retail.service;

import java.util.List;

import com.balance.anole.admin.to.ShopTO;
import com.balance.anole.business.to.BusinessDateTO;
import com.balance.anole.business.to.ShopReceiptTO;
import com.balance.anole.client.retail.vo.RetailReceiptPrintVO;

public interface RetailService {

	/**
	 * Hold receipt of currently.
	 * @param List<ShopReceiptTO>
	 * @return ShopReceiptTO
	 */
	public ShopReceiptTO holdReceipt(ShopReceiptTO receipt);

	/**
	 * List held receipt of currently.
	 * @param agentId
	 * @return List<ShopReceiptTO>
	 */
	public List<ShopReceiptTO> getListOfHeldReceipt(String agentId);

	/**
	 * Release held receipt.
	 * @param ShopReceiptTO
	 * @return ShopReceiptTO
	 */
	public ShopReceiptTO releaseReceipt(ShopReceiptTO receipt);

	/**
	 * Cancel the held receipt.
	 *
	 * @param receipt
	 */
	public void cancelHeldReceipt(ShopReceiptTO receipt);

	/**
	 * 1. Create new receipt or update one.
	 * 2. Create new payment list or update ones.
	 * @param ShopReceiptTO
	 * @return void
	 */
	public ShopReceiptTO insertOrUpdateRetailRecord(ShopReceiptTO receipt);

	/**
	 * Retrieve a batch of receipts to upload to server side.
	 * Payment and product item lists are fetched out accordingly.
	 *
	 * @param shopTO
	 * @param bizDt
	 * @param batchSize
	 * @return
	 */
	public List<ShopReceiptTO> getShopReceipts4Upload(ShopTO shopTO, BusinessDateTO bizDt, Integer batchSize);

	/**
	 * Save the receipt and associated product list, payment list. If the printVO is not null, then print the receipt.
	 *
	 * @param printVO
	 * @param receipt
	 * @param needPay
	 * @param paid
	 * @param change
	 */
	public void payBill(RetailReceiptPrintVO printVO, ShopReceiptTO receipt, String needPay,
			String paid, String change);

}
